home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1599 / 1424 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  4.9 KB

  1. Subject: Re: MiNTOS Distribution World Wide Web page now available.
  2. Date: Sat, 21 May 94 1:22:24 CDT
  3. From: Juergen Lock <nox@jelal.north.de>
  4. In-Reply-To: <9405181403.AA15282@telle.dmi.stevens-tech.edu>; from "Scott Kolodzieski" at May 18, 94 10:03 am
  5. Message-Id: <9405202322.AA00661@jelal.north.de>
  6.  
  7. Scott Kolodzieski writes:
  8. > Hello all, 
  9. > I have a TT 4+16, and just set up MiNTOS on it. I saw some some chatter 
  10. > recently about people starting gem.sys from the MultiTOS distribution up 
  11. > after they login as root. 
  12. > When I login as root and start MultiTOS, it come up fine and appears
  13. > to work as long as I don't touck the keyboard. I can
  14. > drag/drop/launch/copy/move files and the like. If I open TOSWIN, and
  15. > begin typing, or a com program and begin typing, the machine takes 4
  16. > or 5 keystrokes (correctly echoing) then stops accepting input from
  17. > the keyboard. a quik cntrl+alt+f1 shows MiNT(v1.10 + net patches) is
  18. > still alive as the new Minix FS update is being called (I assume by
  19. > addroottimeout()) and the mouse moves, but I cannot type or select
  20. > anything with the mouse. Odd huh?
  21.  
  22.  sounds like the old GEM SIGTT* hang...  i.e. GEM does some strange
  23. things with its tty that make it end up in state `stop'.  (verify with
  24. ctrl-alt-f6...)
  25.  
  26.  heres a start-GEM thing i made for virtual consoles, the hack is to
  27. reset /dev/consoles process group to 0 like if it was closed... :/
  28.  
  29. /* execgem -- exec `old' GEM (exec_os) or a gem.sys (-DINITPRG)
  30.    make sure we're on console, zero its pgroup to reduce GEM SIGTTIN/OU
  31.    problems (don't ask), exec.  INITPRG can also be a script so you
  32.    can create an account `gem' in /etc/passwd if you want with this
  33.    as loginshell and put setup things in the script. (last line execs
  34.    the real gem.)
  35.  
  36.    BUGS: still no way to leave GEM & free all its memory etc. other
  37.    than reboot. :-(  if someone manages to shut down GEM and later
  38.    restart it without spectacular crashes and losing memory _please_
  39.    tell us how...
  40. */
  41.  
  42. #include <stdio.h>
  43. #include <string.h>
  44. #include <stat.h>
  45. #include <fcntl.h>
  46. #include <ioctl.h>
  47. #include <unistd.h>
  48. #include <errno.h>
  49. #include <mintbind.h>
  50. #include <basepage.h>
  51. #include <st-out.h>
  52.  
  53. #ifdef INITPRG
  54. #define init_prg INITPRG
  55. #define init_tail "\0"
  56. #define init_env 0L
  57. #else
  58. #define init_prg 0L
  59. #define init_tail ""
  60. #define init_env 0L
  61. #endif
  62.  
  63. #define EXEC_OS 0x4feL
  64.  
  65. /* define how to call functions with stack parameter passing */
  66. #ifdef __TURBOC__
  67. #define ARGS_ON_STACK cdecl
  68. #else
  69. #define ARGS_ON_STACK
  70. #endif
  71.  
  72. #ifndef P_
  73. # ifdef __STDC__
  74. #  define P_(x) x
  75. # else
  76. #  define P_(x) ()
  77. # endif
  78. #endif
  79.  
  80. /* not yet in st-out.h... */
  81. #ifndef F_PROT_P
  82. #define F_PROT_P    0x00        /* no read or write */
  83. #define F_PROT_G    0x10        /* any access OK */
  84. #define F_PROT_S    0x20        /* any super access OK */
  85. #define F_PROT_PR    0x30        /* any read OK, no write */
  86. #define F_PROT_I    0x40        /* invalid page */
  87. #endif
  88.  
  89. int
  90. main(argc, argv)
  91.     int argc;
  92.     char **argv;
  93. {
  94.     long stack;
  95.     extern int __mint;
  96.  
  97.     if (__mint) {
  98.         struct stat sb, st;
  99.         BASEPAGE *bp;
  100.         long pgrp, r;
  101.         char tmp[0x100];
  102.  
  103.         if (Fcntl(-1, &pgrp, TIOCGPGRP) ||
  104.             Fcntl(-1, &sb, FSTAT) ||
  105.             (Fxattr(0, "u:\\dev\\ttyv0", &st) &&
  106.             Fxattr(0, "u:\\dev\\vt00", &st) &&
  107.             Fxattr(0, "u:\\dev\\console", &st)) ||
  108.             ((st.st_dev != sb.st_dev || st.st_ino != sb.st_ino) &&
  109.              (Fxattr(0, "u:\\dev\\fasttext", &st) ||
  110.                 st.st_dev != sb.st_dev || st.st_ino != sb.st_ino))) {
  111.  
  112.             Cconws ("Hey GEM is not X! :)  console only...\r\n");
  113.             return 1;
  114.         }
  115.  
  116.         /* just to be sure... */
  117.         (void) Fclose (0);
  118.         (void) Fcntl(-1, 0L, F_DUPFD);
  119.         (void) Fclose (1);
  120.         (void) Fcntl(-1, 0L, F_DUPFD);
  121.         (void) Fclose (2);
  122.         (void) Fcntl(-1, 0L, F_DUPFD);
  123.  
  124.         /* `turn off' job control on /dev/console, GEM seems to have
  125.            problems with it...  apparently even multitos :-(  */
  126.         r = 0;
  127.         (void) Fcntl(0, &r, TIOCSPGRP);
  128.  
  129.         stack = Super (0L);
  130.         if (init_prg) {
  131.             /* not Pexec so init_prg gets ARGV and can be a script.
  132.             */
  133.             execl (init_prg, init_prg, (char *)0);
  134.             if (errno == ENOEXEC || errno == ENOENT)
  135.                 execl ("/bin/sh", "/bin/sh", init_prg, (char *)0);
  136.             r = errno;
  137.         } else {
  138.             bp = (BASEPAGE *)Pexec(7,
  139.               (char *)((long)F_FASTLOAD | F_ALTLOAD | F_ALTALLOC | F_PROT_S),
  140.               (char *)"\0", init_env);
  141.             bp->p_tbase = *((char **) EXEC_OS );
  142.             r = -Pexec(206, (char *)"GEM", bp, 0L);
  143.         }
  144.         Super (stack);
  145.         sprintf (tmp, "exec %s failed: %s (%d)\r\n",
  146.             init_prg ? init_prg : "GEM", strerror (r), (int) r);
  147.         (void) Fcntl(0, &pgrp, TIOCSPGRP);
  148.         Cconws (tmp);
  149.         return r;
  150.     } else {
  151.         register void ARGS_ON_STACK (*f) P_((long));
  152.  
  153.         /* no MiNT -> just jump thru exec_os... */
  154.         stack = Super (0L);
  155.         f = (void ARGS_ON_STACK (*) P_((long))) *((long *)EXEC_OS);
  156.         Super (stack);
  157.  
  158.         (*f)((long) _base);
  159.         /*NOTREACHED*/
  160.         return 0;
  161.     }
  162. }
  163. > Any tips would be appreciated.
  164. > cheers,
  165. > scott.
  166.  
  167.  hope this helps, cheers
  168.     Juergen
  169. -- 
  170. J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
  171.                                 ...ohne Gewehr
  172. PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA 
  173.